//
//  HomeCollectionViewCell.m
//  TravelDiary
//
//  Created by YDB MAC on 15/11/12.
//  Copyright © 2015年 YDB MAC. All rights reserved.
//

#import "HomeCollectionViewCell.h"

@interface HomeCollectionViewCell ()




@end
@implementation HomeCollectionViewCell
-(instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        _backImageView = [[UIImageView alloc]init];
        _titleLabel = [[UILabel alloc]init];
        _iconImage = [[UIImageView alloc]init];
        [self.contentView addSubview:_backImageView];
        [self.backImageView addSubview:_iconImage];
        [self.contentView addSubview:_titleLabel];
        
    }

    return self;
    

}
-(void)layoutSubviews{
    _backImageView.frame = CGRectMake(0, 0, self.frame.size.width, self.frame.size.width);
//    _backImageView.image= [UIImage imageNamed:@"iconfont-zhed2"];
    _backImageView.layer.masksToBounds = YES;
    _backImageView.layer.cornerRadius = self.backImageView.frame.size.width/2;
    _titleLabel.frame = CGRectMake(CGRectGetMinX(_backImageView.frame), CGRectGetMaxY(_backImageView.frame), CGRectGetWidth(_backImageView.frame), 20);
    _titleLabel.textAlignment = NSTextAlignmentCenter;
    _titleLabel.textColor = [UIColor grayColor];
    
//    _titleLabel.backgroundColor = [UIColor redColor];
    
    _iconImage.frame = CGRectMake(10,10, self.frame.size.width-20, self.frame.size.width-20);
    _iconImage.layer.masksToBounds = YES;
    _iconImage.layer.cornerRadius = self.iconImage.frame.size.width/2;

   

}
@end
